<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.0/css/swiper.min.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.0/js/swiper.min.js"></script>
  <link rel="stylesheet" href="./style.css">
</head>

<body>
  <!-- 定义父swiper -->
  <div class="swiper-container first-one">
    <div class="swiper-wrapper">
      <div class="swiper-slide">我是父亲swiper的第一个slide</div>
      <div class="swiper-slide">我是父亲swiper的第二个slide</div>
      <div class="swiper-slide">我是父亲swiper的第三个slide</div>
      <div class="swiper-slide">

        <!-- 定义嵌套的子swipe -->
        <div class="swiper-container second-one">
          <div class="swiper-wrapper">
            <div class="swiper-slide">我是儿子swiper的第一个slide</div>
            <div class="swiper-slide">我是儿子swiper的第二个slide</div>
            <div class="swiper-slide">我是儿子swiper的第三个slide</div>
            <div class="swiper-slide">我是儿子swiper的第四个slide</div>
          </div>
        </div>

      </div>
    </div>
  </div>
  <script>
    var first_swiper = new Swiper('.first-one', {
      // 这里可以不写任何东西，swiper会按照默认参数进行初始化
    });

    var second_swiper = new Swiper('.second-one', {
      direction: 'vertical', // 垂直切换选项
      // 这里可以不写任何东西，swiper会按照默认参数进行初始化
    });
  </script>
</body>

</html>